package org.jsola.hr.dto;

import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.format.DateTimeFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;
import org.jsola.contract.constant.FileType;
import org.jsola.core.dto.BaseDTO;
import org.jsola.core.validator.Const;
import org.jsola.hr.constant.convert.ContractStatusEnumConverter;
import org.jsola.hr.constant.convert.DateConverter;
import org.jsola.hr.constant.convert.FileTypeConverter;

import java.util.Date;

import static org.jsola.hr.example.EmpContractExample.*;

/**
 * 员工纸质合同信息
 *
 * @author zhr
 */
@EqualsAndHashCode(callSuper = true)
@ApiModel(description = "员工纸质合同导入参数")
@Data
public class EmpPaperContractImportDTO extends BaseDTO {

    private static final long serialVersionUID = 1L;

    @ExcelProperty(value = "身份证号")
    private String idCard;

    @ExcelProperty(value = "姓名")
    private String empName;

    @ExcelProperty(value = "合同编号")
    private String number;


    @ApiModelProperty(notes = N_TYPE, example = E_TYPE, allowableValues = FileType.VALUES_STR)
    @Const(constClass = FileType.class, message = "合同类型不合法")
    @ExcelProperty(value = "合同类型", converter = FileTypeConverter.class)
    private String type;

    @ApiModelProperty(value = "合同名称")
    @ExcelProperty(value = "合同名称")
    private String name;

    @ApiModelProperty(notes = "合同期限")
    @ExcelProperty(value = "合同期限")
    private String termStr;

    @ApiModelProperty(notes = N_REMARK, example = E_REMARK)
    @Length(max = 2147483647, message = M_REMARK_MAX)
    @ExcelProperty(value = "合同备注")
    private String remarks;

    @ApiModelProperty(notes = N_START_TIME, example = E_START_TIME)
    @DateTimeFormat("yyyy-MM-dd")
    private Date startTime;

    @ExcelProperty(value = "合同开始时间")
    private String startTimeStr;

    @ApiModelProperty(notes = N_END_TIME, example = E_END_TIME)
    @DateTimeFormat("yyyy-MM-dd")
    private Date endTime;

    @ExcelProperty(value = "合同结束时间")
    private String endTimeStr;

    @ApiModelProperty(notes = "合同公司")
    @ExcelProperty(value = "合同公司")
    private String companyName;

    @ApiModelProperty(notes = "合同状态")
    @ExcelProperty(value = "合同状态", converter = ContractStatusEnumConverter.class)
    private Integer status;

    @ApiModelProperty(notes = "合同签订日期")
    @DateTimeFormat("yyyy-MM-dd")
    @ExcelProperty(value = "合同签订日期", converter = DateConverter.class)
    private Date subscribeTime;

    @ExcelProperty(value = "合同签订日期")
    private String subscribeTimeStr;

    @ApiModelProperty(notes = "原因")
    private String reason;

    @ApiModelProperty(notes = "错误字段")
    private String field;

}

